import request from '@/utils/request'

// 查询所有工厂
export function listALLFactory(query) {
  return request({
    url: '/qcmasterdata/plant/listAll',
    method: 'get',
    params: query
  })
}
export function listBaseFactory(query) {
  return request({
    url: '/qcmasterdata/base/list',
    method: 'get',
    params: query
  })
}
// 查询工厂列表
export function listFactory(query) {
  return request({
    url: '/qcmasterdata/plant/list',
    method: 'get',
    params: query
  })
}
// 查询工厂列表
export function plantListAll(query) {
  return request({
    url: '/qcmasterdata/plant/listAll',
    method: 'get',
    params: query
  })
}
// 查询工厂列表
export function listAllFactory(query) {
  return request({
    url: '/qcmasterdata/plant/listAll',
    method: 'get',
    params: query
  })
}

// 查询工厂详细
export function getFactory(id) {
  return request({
    url: '/qcmasterdata/plant/' + id,
    method: 'get'
  })
}

// 新增工厂
export function addFactory(data) {
  return request({
    url: '/qcmasterdata/plant',
    method: 'post',
    data: data
  })
}

// 修改工厂
export function updateFactory(data) {
  return request({
    url: '/qcmasterdata/plant',
    method: 'put',
    data: data
  })
}

// 删除工厂
export function delFactory(id) {
  return request({
    url: '/qcmasterdata/plant/' + id,
    method: 'delete'
  })
}

// 导出工厂
export function exportFactory(query) {
  return request({
    url: '/qcmasterdata/plant/export',
    method: 'post',
    params: query
  })
}
// 驾驶舱base
export function listBaseAPI(divisionId) {
  return request({
      url: '/qcmasterdata/plant/listBase?divisionId='+divisionId,
      method: 'get'
  })
}